home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / environ.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  4KB  |  116 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. //  ENVIRON.H - Environment Class Include File
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/11/26 - Added max_reflect data member.
  9. //                       - Added GetMaxReflect and
  10. //                         SetMaxReflect functions.
  11. //                       - Modified Environ to initialize
  12. //                         max_reflect.
  13. //              94/12/16 - Version 1.01A release.
  14. //              95/02/05 - Version 1.02A release.
  15. //              95/07/21 - Version 1.02B release.
  16. //              96/02/14 - Version 1.02C release.
  17. //              96/03/30 - Added max_x, max_y, max_z, min_x,
  18. //                         min_y and min_z data members.
  19. //                       - Added GetMax_X, GetMax_Y,
  20. //                         GetMax_Z, GetMin_X, GetMin_Y and
  21. //                         GetMin_Z functions.
  22. //                       - Added CalcExtents function
  23. //                         prototype.
  24. //              96/04/01 - Version 1.03A release.
  25. //
  26. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  27. //              Borland C++ Version 4.5
  28. //
  29. //  Author:     Ian Ashdown, P.Eng.
  30. //              byHeart Software Limited
  31. //              620 Ballantree Road
  32. //              West Vancouver, B.C.
  33. //              Canada V7S 1W3
  34. //              Tel. (604) 922-6148
  35. //              Fax. (604) 987-7621
  36. //
  37. //  Copyright 1994-1996 byHeart Software Limited
  38. //
  39. //  The following source code has been derived from:
  40. //
  41. //    Ashdown, I. 1994. Radiosity: A Programmer's
  42. //    Perspective. New York, NY: John Wiley & Sons.
  43. //
  44. //  It may be freely copied, redistributed, and/or modified
  45. //  for personal use ONLY, as long as the copyright notice
  46. //  is included with all source code files.
  47. //
  48. ////////////////////////////////////////////////////////////
  49.  
  50. #ifndef _ENVIRON_H
  51. #define _ENVIRON_H
  52.  
  53. #include "instance.h"
  54.  
  55. class Environ   // Environment
  56. {
  57.   private:
  58.     double max_reflect;     // Maximum reflected color
  59.     double max_x;           // Maximum x-axis extent
  60.     double max_y;           // Maximum y-axis extent
  61.     double max_z;           // Maximum z-axis extent
  62.     double min_x;           // Minimum x-axis extent
  63.     double min_y;           // Minimum y-axis extent
  64.     double min_z;           // Minimum z-axis extent
  65.     Instance *pinsthd;      // Instance list pointer
  66.     WORD num_inst;          // Number of instances
  67.     WORD num_surf;          // Number of surfaces
  68.     WORD num_patch;         // Number of patches
  69.     WORD num_elem;          // Number of elements
  70.     WORD num_vert;          // Number of vertices
  71.  
  72.     friend class Parse;
  73.  
  74.   public:
  75.     Environ()
  76.     {
  77.       pinsthd = NULL;
  78.       max_reflect = 0.0;
  79.     }
  80.  
  81.     ~Environ() { DeleteEnv(); }
  82.  
  83.     double GetMaxReflect() { return max_reflect; }
  84.     double GetMax_X() { return max_x; }
  85.     double GetMax_Y() { return max_y; }
  86.     double GetMax_Z() { return max_z; }
  87.     double GetMin_X() { return min_x; }
  88.     double GetMin_Y() { return min_y; }
  89.     double GetMin_Z() { return min_z; }
  90.     Instance *GetInstPtr() { return pinsthd; }
  91.     WORD GetNumInst() { return num_inst; }
  92.     WORD GetNumSurf() { return num_surf; }
  93.     WORD GetNumPatch() { return num_patch; }
  94.     WORD GetNumElem() { return num_elem; }
  95.     WORD GetNumVert() { return num_vert; }
  96.     void CalcExtents();
  97.     void DeleteEnv()
  98.     {
  99.       Instance *pinst;  // Instance pointer
  100.       Instance *pnext;  // Next instance pointer
  101.  
  102.       pinst = pinsthd;
  103.       while (pinst != NULL)
  104.       {
  105.         pnext = pinst->GetNext();
  106.         delete pinst;
  107.         pinst= pnext;
  108.       }
  109.       pinsthd = NULL;
  110.     }
  111.     void SetMaxReflect( double mr ) { max_reflect = mr; }
  112. };
  113.  
  114. #endif
  115.  
  116.